package ZY10_20;

import java.util.Scanner;

public class GoShopTest {
    public static void main(String[] args) {
//        String names="顶呱呱商场";
//        String site="清明路";
        Shopping s=new Shopping();
        s.names="顶呱呱商场";
        s.site="清明路";
        while (true){
            s.show();
            System.out.println("1.添加新会员，2.加积分，3.查看全部会员，4.兑换礼品,0.退出");
            Scanner in=new Scanner(System.in);
            int a=in.nextInt();
            if (a==1){
                System.out.println("请输入会员号：");
                String id=in.next();
                System.out.println("请输入姓名：");
                String name=in.next();
                System.out.println("请输入手机号：");
                String phone=in.next();
                System.out.println("请输入积分：");
                int integral=in.nextInt();
                VIP v=new VIP(id,name,phone,integral);
                s.newvip(v);
                boolean c=s.checkCardNoRepeat(id);
                System.out.println(c?"重复":"不重复");
            }else if (a==2){
                System.out.println("请输入会员号：");
                String c=in.next();
                System.out.println("加多少分？");
                int d=in.nextInt();
                boolean z=s.inc(c,d);
                System.out.println(z?"加分成功":"加分失败");
            }else if (a==3){
                s.huiyuan();
            }
            else if (a==0){
                break;
            }
        }
    }
}
